﻿@model IPagedList<RolesDto>
<!-- 接收强类型视图传递过来的值 -->
@{
    string search = ViewBag.Search;
    int pageIndex = ViewBag.PageIndex;
}


<div class="panel panel-headline">
    <div class="panel-heading">
        <h3 class="panel-title">身份信息管理</h3>
        <p class="panel-subtitle"></p>
    </div>
    <div class="panel-body">
        <div class="row" style="margin-bottom:5rem;">
            <div class="col-8">
                <form action="/manage/RolesManager/List" method="get" class="form-inline">
                    @Html.TextBox("search", search, new { @class = "form-control", style = "width:80rem;" })
                    <button class="btn btn-primary">
                        <i class="fa fa-search"></i>
                        搜索
                    </button>
                    <a href="/manage/RolesManager/Add" class="btn btn-success">
                        <i class="fa fa-pencil"></i>
                        新增
                    </a>
                    <a href="" class="btn btn-danger">
                        <i class="fa fa-trash"></i>
                        删除已选中的
                    </a>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th>
                                <input type="checkbox" name="selectAll" id="selectAll" /> 全选
                            </th>
                            <th>序号</th>
                            <th>身份名称</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (RolesDto roles in Model)
                        {
                            <tr>
                                <td>
                                    <input type="checkbox" name="ckItem" value="@roles.Id" />
                                </td>
                                <td>@roles.Id</td>
                                <td>@roles.Title</td>
                                <td>@roles.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
                                <td>
                                    <a href="#" class="btn btn-warning">
                                        <i class="fa fa-pencil"></i>
                                        修改
                                    </a>
                                    <a href="#" class="btn btn-danger">
                                        <i class="fa fa-trash"></i>
                                        删除
                                    </a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
        <div class="row" style="margin-top:5rem;">
            <div class="col-12">

                <!-- 这个位置我们用于存放分页插件，分页插件的语法采用的是HTML帮助标签的写法 -->
                @Html.PagedListPager(Model, pageIndex => Url.Action("List", "RolesManager",
                         new { pageIndex, search = search }, "http", "localhost:5217"))

            </div>

        </div>


    </div>

</div> 